//
//  TakeDrugHeaderView.m
//  安好
//
//  Created by lianchuang on 14-11-14.
//  Copyright (c) 2014年 lianchuangbrother. All rights reserved.
//

#import "TakeDrugHeaderView.h"

@implementation TakeDrugHeaderView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        
        [self makeHeaderView];
    }
    return self;
}
-(void)makeHeaderView
{
    CGFloat headerHeight = self.frame.size.height;
    CGFloat headerGreyBarHeight = 10.0;
    //底部View --之后的view都贴在这个view上面
    self.headerBackView = [[UIView alloc] initWithFrame:self.bounds];
    self.headerBackView.backgroundColor = [ClassMethodsViewController colorWithHexString:BACK_BACKGROUNDCOLOR_16];
    [self addSubview:self.headerBackView];
    //头部线(0,0,320,1)
    self.headerTopLineView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 1)];
    self.headerTopLineView.backgroundColor = [ClassMethodsViewController colorWithHexString:LINE_BACKGROUNDCOLOR_16];
    [self.headerBackView addSubview:self.headerTopLineView];
    //可触发的btn --(0,10,320,headerHeight-10-1)//留出1来帖bottomLine
    self.headerBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.headerBtn.backgroundColor = [UIColor whiteColor];
    self.headerBtn.frame = CGRectMake(0, headerGreyBarHeight,kScreenWidth,headerHeight-headerGreyBarHeight-1);
    self.headerBtn.userInteractionEnabled = YES;
    [self.headerBackView addSubview:self.headerBtn];
    
    //可贴文本的lable 贴在btn上
    self.headerLable = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, kScreenWidth-15, headerHeight-headerGreyBarHeight-1)];
    self.headerLable.userInteractionEnabled = NO;
    self.headerLable.font = [UIFont systemFontOfSize:15];
    self.headerLable.text = NSTextAlignmentLeft;
    [self.headerBtn addSubview:self.headerLable];
    //btn 上部的线
    self.headerBtnTopLine = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 1)];
    self.headerBtnTopLine.backgroundColor = [ClassMethodsViewController colorWithHexString:LINE_BACKGROUNDCOLOR_16];
    [self.headerBtn addSubview:self.headerBtnTopLine];
    //"有/无"
    self.headerMyRemindLable = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 30-61, 0, 60, headerHeight-11)];
    self.headerMyRemindLable.font = [UIFont systemFontOfSize:15];
    self.headerMyRemindLable.text = @"无提醒";
    self.headerMyRemindLable.textAlignment = NSTextAlignmentCenter;
    [self.headerBtn addSubview:self.headerMyRemindLable];

    // 跳转箭头
    self.headerAccessoryImgView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth-30,(self.headerBtn.frame.size.height-15)/2.0 , 15, 15)];
    self.headerAccessoryImgView.userInteractionEnabled = NO;
    [self.headerBtn addSubview:self.headerAccessoryImgView];
    //视图 底部线
    self.headerBottomLineView = [[UIImageView alloc] initWithFrame:CGRectMake(0, headerHeight-1, 320, 1)];
    self.headerBottomLineView.backgroundColor = [ClassMethodsViewController colorWithHexString:LINE_BACKGROUNDCOLOR_16];;
    [self.headerBackView addSubview:self.headerBottomLineView];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
